<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
  xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
  layout:decorator="layout">
  <head>
    <title>登录</title>
    <script type="text/javascript">
    	var userLogin = function(){
    		var userName = $("input[name='userName']").val();
        	var password = $("input[name='password']").val();
    	    $.ajaxData({url:"login-login",type:"post",data:{userName:userName,password:password},success:function(ret){
    	    	if(ret.success){
    	    		location.href="/index";
    	    	} else {
    	    		$.jjalert(ret.msg);
    	    	}
    	    }});
    	}
    	
    </script>
  </head>
  <body>
    <div class="body" layout:fragment="content">
    	<div class="login-block">
    		<h3 class="login-title">登录</h3>
    		<div class="login-user">
    			<input class="login-user-input" type="text" placeholder="手机号" name="userName"/>
    		</div>
    		<div class="login-user">
    			<input class="login-user-input" type="password" placeholder="密码" name="password"/>
    		</div>
    		<div class="login-btn">
    			<button class="login-btn-button" onclick="userLogin()">登录</button>
    		</div>
    		
    		<div class="login-reg"><a href="/reg">注册</a></div>
    	</div>
    </div>
  </body>
</html>